/**══════════════════════════════════╗
*作    者：songbaobao                                                 ║
*职    业：我以我血荐轩辕                                              ║                                              
*CSND地址：https://blog.csdn.net/weixin_43949535                       ║
**GitHub ：https://github.com/TsinghuaLucky912/My_own_C-_study_and_blog║
*═══════════════════════════════════╣
*创建时间：                                                           
*功能描述：                                                            
*                                                                      
*                                                                      
*═══════════════════════════════════╣
*结束时间:                                                           
*═══════════════════════════════════╝
//                .-~~~~~~~~~-._       _.-~~~~~~~~~-.
//            __.'              ~.   .~              `.__
//          .'//              西南\./联大               \\`.
//        .'//                     |                     \\`.
//      .'// .-~"""""""~~~~-._     |     _,-~~~~"""""""~-. \\`.
//    .'//.-"                 `-.  |  .-'                 "-.\\`.
//  .'//______.============-..   \ | /   ..-============.______\\`.
//.'______________________________\|/______________________________`.
*/

#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <ctype.h>
#include <queue>
#include <list>
#include <map>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <iomanip>
using namespace std;


int main()
{
#if A1
	int myarray1[10] = { 0 }, last = 0;
	for (int i = 0; i < 9; ++i)
	{
		scanf("%d", &myarray1[i]);
	}
	scanf("%d", &last);

	int i = 0, len = 10;
	for (; i < 9; ++i)
	{
		if (last < myarray1[i])
		{
			break;
		}
	}
	for (int j = 9 - i; j != 0; --j)
	{
		myarray1[len - 1] = myarray1[len - 2];
		len--;
	}
	myarray1[i] = last;
	
	for (int j = 0; j < 10; ++j)
	{
		printf("%d\n", myarray1[j]);
	}
#endif

#if A2
	int myarray1[10] = { 0 }, last = 0;
	for (int i = 0; i < 9; ++i)
	{
		scanf("%d", &myarray1[i]);
	}
	scanf("%d", &myarray1[9]);

	sort(myarray1, myarray1 + 10);
	for (int j = 0; j < 10; ++j)
	{
		printf("%d\n", myarray1[j]);
	}
#endif

#if B
	int myarray1[10] = { 0 };
	for (int i = 0; i < 10; ++i)
	{
		scanf("%d", &myarray1[i]);
	}
	
	for (int j = 9; j >= 0; --j)
	{
		printf("%d\n", myarray1[j]);
	}
#endif

#if C
	int n;
	scanf("%d", &n);
	int** myarray = (int**)malloc(sizeof(int*) * n);
	
	for (int i = 0; i < n; ++i)
	{
		myarray[i] = (int*)malloc(sizeof(int) * n);
		for (int j = 0; j < n; ++j)
			myarray[i][j] = 0;
	}
	if (1 == n)
	{
		printf("1\n");
	}
	else if (2 == n)
	{
		printf("1\n");
		printf("1 1\n");
	}
	else
	{
		myarray[0][0] = 1;
		myarray[1][0] = 1;
		myarray[1][1] = 1;

		for (int i = 3; i <= n; ++i)
		{
			myarray[i - 1][0] = 1;
			myarray[i - 1][i - 1] = 1;
			for (int j = 1; j <= i-1; ++j)
			{
				myarray[i - 1][j] = myarray[i - 2][j - 1] + myarray[i - 2][j];
			}
		}
	}
	for (int i = 0; i < n; ++i)
	{
		int count = 1;
		for (int j = 0; j < n; ++j)
		{
			if (myarray[i][j] == 0)
			{
				break;
			}
			if (count == i + 1)
			{
				printf("%d", myarray[i][j]);
			}
			else
			{
				printf("%d ", myarray[i][j]);
				count++;
			}
		}
		printf("\n");
	}
	for (int i = 0; i < n; ++i)
	{
		free(myarray[i]);
	}
#endif

#if D
	char str1[512];
	char* str = nullptr;
	scanf("%s", str1);
	str = str1;
	while (*str != '\0')
	{
		if (*str >= 'A' && *str <= 'Z')
		{
			*str = ('Z' - (*str - 'A'));
		}
		else if (*str >= 'a' && *str <= 'z')
		{
			*str = ('z' - (*str - 'a'));
		}
		str++;
	}
	printf("%s\n", str1);
#endif

#if E
	char strm[512] = { 0 };
	char strn[512] = { 0 };
	char* str1 = nullptr;
	char* str2 = nullptr;
	gets_s(strm);
	gets_s(strn);
	int result = 0;

	str1 = strm, str2 = strn;
	while (*str1 != '\0' && *str2 != '\0')
	{
		if (*str1 != * str2)
		{
			result = *str1 - *str2;
			printf("%d\n", result);
			break;
		}
		str1++;
		str2++;
	}
#endif

#if F
	int myarray[10] = { 0 };
	for (int i = 0; i < 10; ++i)
	{
		scanf("%d", myarray + i);
	}
	for (int j = 9; j >= 0; --j)
	{
		printf("%d\n", myarray[j]);
	}
#endif

#if G
	int myarray[20] = { 0 };
	myarray[0] = myarray[1] = 1;
	for (int i = 2; i < 20; ++i)
	{
		myarray[i] = myarray[i - 1] + myarray[i - 2];
	}
	for (int i = 0; i < 20; ++i)
	{
		printf("%d\n", myarray[i]);
	}
#endif

#if H
	int myarray[10] = { 0 };
	bool flag = false;
	for (int i = 0; i < 10; ++i)
	{
		scanf("%d", myarray + i);
	}
	for (int i = 0; i < 9; ++i)
	{
		flag = true;
		for (int j = 0; j < 9 - i; ++j)
		{
			if (myarray[j] > myarray[j + 1])
			{
				swap(myarray[j], myarray[j + 1]);
				flag = false;
			}
		}
		if (flag)
			break;
	}
	for (int i = 0; i < 10; ++i)
		printf("%d\n", myarray[i]);
#endif

#if I
	int myarray1[2][3];
	for (int i = 0; i < 2; ++i)
	{
		for (int j = 0; j < 3; ++j)
		{
			scanf("%d", &myarray1[i][j]);
		}
	}
	for (int i = 0; i < 3; ++i)
	{
		int j = 0;
		for (; j < 1; ++j)
		{
			printf("%d ", myarray1[j][i]);
		}
		printf("%d\n", myarray1[j][i]);
	}
#endif

#if J
	char strm[512] = { 0 };
	char strn[512] = { 0 };
	char stro[512] = { 0 };
	gets_s(strm);
	gets_s(strn);
	gets_s(stro);

	if (strcmp(strm, strn) < 0 && strcmp(strn, stro) < 0)
	{
		printf("%s\n", stro);
	}
	if (strcmp(strn, strm) < 0 && strcmp(stro, strm) < 0)
	{
		printf("%s\n", strm);
	}
	if (strcmp(strm, strn) < 0 && strcmp(stro, strn) < 0)
	{
		printf("%s\n", strn);
	}
#endif
	return 0;
}
/**
*备用注释：
*
*
*
*/